package com.object.oriented.concept;

/**
 * 三大特征之封装
 * 将结构、数据、操作封装在对象实体中，使用时可以不关注对象内部结构，只能访问开放权限的功能入口，从而降低程序耦合程度，提供安全性和可持续维护性。
 */
public class Concept01 {
    public static void main(String[] args) {
        Student student = new Student("张三","高三",29f);
        student.conclusion();
    }
}

class Student {
    private String name ;
    private String grade ;
    private Float score ;
    public Student(String name, String grade, Float score) {
        this.name = name;
        this.grade = grade;
        this.score = score;
    }
    public void conclusion (){
        System.out.println("姓名："+this.getName());
        System.out.println("年级："+this.getGrade());
        System.out.println("分数："+this.getGrade());
        if (this.getScore() >= 100.0f){
            System.out.println("评语：本学期优等生");
        } else {
            System.out.println("评语：本学期潜力股");
        }
    }
    public String getName() {
        return name;
    }
    public String getGrade() {
        return grade;
    }
    public Float getScore() {
        return score;
    }
}